Skip to content

fix(stt): offer every whisper.cpp language in the regenerate picker (cherry-pick to 1.10.0.rc2) - #475

Merged
EtienneLescot merged 3 commits into
release/v1.10.0from
cherrypick/stt-language-selector-1.10.0
Aug 22, 2026
Merged

fix(stt): offer every whisper.cpp language in the regenerate picker (cherry-pick to 1.10.0.rc2)#475
EtienneLescot merged 3 commits into
release/v1.10.0from
cherrypick/stt-language-selector-1.10.0

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Cherry-pick of #468 onto release/v1.10.0 for 1.10.0.rc2, per request. Clean cherry-pick, no conflicts:

  • 62d6809f fix(stt): offer every whisper.cpp language in the regenerate picker
  • 05eb06b4 fix(stt): wire the language list into the picker that's actually live
  • 8d7e4dda fix(stt): validate regenLang against the known code list

See #468 for the full description, the subagent code review that caught the second commit's fix, and the CodeRabbit review (0 actionable comments remaining).

Test plan

  • npx tsc — clean
  • npx biome check on the changed/new files — clean
  • node scripts/check-docs.mjs — clean
  • vitest run on schema/index.test.ts, transcriptionStore.test.ts, transcription/status.test.ts, TranscriptionStatus.test.tsx, TranscriptPane.gating.test.tsx, MediaStage.test.ts — all passing

🤖 Generated with Claude Code

The "Regenerate as" selector only listed 11 hand-picked languages while
the shipped whisper small model transcribes ~100. TRANSCRIPT_LANGUAGE_CODES
in schema/index.ts is now the single source of truth (mirrors whisper.cpp's
own g_lang table) for both the zod schema and the picker, which sorts by
name localized via Intl.DisplayNames (falling back to whisper's English
name) instead of a hardcoded list of bare codes.
A subagent review caught that the first commit only widened
SourceTranscriptModal, which NewEditorShell never mounts (LeftPanel is
always rendered with active="chat"). The picker a real user opens is
MediaStage.tsx's own, separate <select>, still hardcoded to auto/en/fr/es.

- Extract language-label resolution into
  lib/ai-edition/transcription/languageLabels.ts (languageLabel,
  sortedLanguageOptions) so both pickers share one implementation instead
  of drifting the way the original hand-duplicated lists did.
- Wire MediaStage.tsx's picker onto it.
- Fix the "detected language" pill in both components to show a localized
  name instead of the raw whisper code.
- Guard Intl.Collator the same way Intl.DisplayNames already was, and cache
  a failed Intl.DisplayNames construction instead of retrying it on every
  language in the list.
- Move TRANSCRIPT_LANGUAGE_NAMES out of the schema module (bundled into the
  Electron main process) into the new UI-facing module, and collapse three
  copies of `Exclude<TranscriptLanguageCode, "auto">` into one exported
  WhisperLanguageCode type.
CodeRabbit review: AxcutTranscript.language is an unvalidated
z.string().min(1), so a stored transcript holding a code outside the ~100
known ones would leave the select unmatched and submit a code Whisper
can't resolve. Parse it through transcriptLanguageSchema and fall back to
"auto" in both the init and the open-sync effect.
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: de014246-7a42-4855-a7e5-f60efdfcc660

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@EtienneLescot
EtienneLescot merged commit eb10b19 into release/v1.10.0 Aug 22, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant